home *** CD-ROM | disk | FTP | other *** search
- h23279
- s 00007/00001/00199
- d D 1.2 95/06/29 13:36:29 tom 2 1
- c Skunkware port
- e
- s 00200/00000/00000
- d D 1.1 95/05/08 19:41:43 tom 1 0
- c date and time created 95/05/08 19:41:43 by tom
- e
- u
- U
- t
- T
- I 1
- #ifndef _global_h
- #define _global_h
-
- // Directory, in which to put the bitmap files for deluxe-playing
- D 2
- #define DATA_DIRECTORY "fly.dta"
- E 2
- I 2
- #ifdef ANCILLA
- #define DATA_DIRECTORY "/u/games/lib/flying-6.11/fly.dta"
- #endif
-
- #ifdef SKUNKWARE
- #define DATA_DIRECTORY "/usr/skunk/lib/flying-6.11/fly.dta"
- #endif
- E 2
-
- // name of the file to look for static data of the classes
- #define PRESET_FILE "presets.txt"
-
- #define LOG_FILE DATA_DIRECTORY"/logfile.txt"
-
- //
- // As an optimization, every DynObj gets a storage for caching the calculated
- // collision-times with other objects. At the moment of a collision, only
- // the 2 objects taking part in the collision have to update their cache
- // and probably inform other objects about their changes.
- #define TIME_CACHE 1
-
- //
- // The collision detection can be aborted at an early stage, when a minimum
- // time can be estimated which lies beyond a limit.
- // Problem: - The check, if to abort, already takes too much time.
- // - When time-caching is on, advanced collision times, which aren't
- // of any use at the moment of calculation, might be used later on.
- #define ABORT_CALC 0
- #if (ABORT_CALC)
- # define ABORT_CALC_WALL 0
- # define ABORT_CALC_BALL 0
- #endif
-
- //
- // The basic floating point class can be exchanged between doubles and
- // floats. The latter one is faster on my 386.
- #ifndef __TURBOC__
- # define REAL_IS_FLOAT 0
- #else
- # define REAL_IS_FLOAT 1
- #endif
-
- //
- // A real C++-Class can be used for real arithmetic. Unfortunately
- // that really slows the calculation down, even though the whole class
- // is defined inline.
- #define REAL_IS_CLASS 0
-
- //
- // There are some specialized vector classes for 2 and 3 dimensional
- // vectors, which can also be realized by inheriting from an universal
- // vector-class (but again, that's expensive)
- #define Vec2IsVector 0
- #define Vec3IsVector 0
-
- //
- // Switch to pre-existing (better to understand) algorithms for
- // collision detection, instead of the special algortithm (which is
- // a bit faster).
- #define EasyWall 0
-
- //
- // special constants instead of the collision time
- #define MAX_TIME 1e10
- #define NO_HIT MAX_TIME
- #define NO_TARGET MAX_TIME
- #define RUNNING_LOSE 4e10
- #if (ABORT_CALC)
- # define NOT_REACHABLE 2e10
- #endif
-
- //
- // constants to overcome the problem with unprecise real-arithmetics
- #if (REAL_IS_FLOAT)
- # define EPS 1e-4
- #else
- # define EPS 1e-10
- #endif
-
- //
- // current time in calculation
- // not to mix up with the realtime of GetCurrentTime()
- //
- extern double current_time;
-
- #ifndef __TURBOC__
- # define _DEBUG
- #endif
- //
- // debugging switches, the main switch DEBUG enables all successive
- // options, mainly leading to traces on stdout
- #ifdef DEBUG
-
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-
- extern long debug; // Variable der anzuzeigenden modes
- #define ShowLight 0x00000001l
- #define ShowColors 0x00000002l
- #define ShowRings 0x00000004l
- #define ObjectInfo 0x00000008l
- #define BeforCollision 0x00000010l
- #define AfterCollision 0x00000020l
- #define CheckBoundary 0x00000040l
- #define MoveAll 0x00000080l
- #define __Moves 0x000000f8l
- #define PBallHit 0x00000100l
- #define PointerMove 0x00000200l
- #define XWallHit 0x00000400l
- #define YWallHit 0x00000800l
- #define CollCalc 0x00001000l
- #define AbortCalc 0x00002000l
- #define AbortReCalc 0x00004000l
- #define StickLevel 0x00008000l
- #define GameState 0x00010000l
- #define BMover 0x00020000l
- #define BState 0x00040000l
- #define Sync 0x00080000l
- #define ShowTurns 0x00100000l
- #define Loops 0x00200000l
- #define __ShowAll 0x00100007l
- #define __Rings 0x00100004l
- #define Intro 0x00400000l
- #define xdb 0x00800000l
- #define xwd 0x02000000l
- #define ForceCalc 0x01000000l
- #define Motion 0x04000000l
-
- #define TCTrace 0x40000000l
- #define UnixTrace 0x80000000l
-
- #define ShowSubWindow (ShowLight|ShowColors|ShowRings|ShowTurns)
-
- #define DBG0(m,f) if (debug&m) printf( f )
- #define DBG1(m,f,a) if (debug&m) printf( f,a )
- #define DBG2(m,f,a,b) if (debug&m) printf( f,a,b )
- #define DBG3(m,f,a,b,c) if (debug&m) printf( f,a,b,c )
- #define DBG4(m,f,a,b,c,d) if (debug&m) printf( f,a,b,c,d )
-
- int set_debug( const char *flag_name );
- void show_flags();
-
- #else
-
- #define DBG0(m,f)
- #define DBG1(m,f,a)
- #define DBG2(m,f,a,b)
- #define DBG3(m,f,a,b,c)
- #define DBG4(m,f,a,b,c,d)
-
- #endif
-
- #include "stdinc.h"
-
- //
- // Fⁿr Zeitmessungen kann das Zeichnen der sich bewegenden BΣlle komplett
- // unterdrⁿckt werden, indem die DrawCircle()-Funktion durch eine leere
- // Funktion ersetzt wird.
- #define STATISTICS
- #define _NO_DRAW
-
- //
- // Reibungsimplementierung, in dem schrittweise
- // die Geschwindigkeit verkleinert wird. Das Problem ist allerdings, das mit
- // jedem Schritt die Zeiten des TIME-CACHE ungⁿltig werden, und daher
- // nicht zu viele Schritte pro Sekunden eingelegt werden sollten.
- // Die Parametrierung der Reibung und der Aufl÷sung der Schrittberechnung
- // geschieht durch virtuelle Funktionen der Game-Klasse
- //
- // Einschalten der Reibungssimulation durch stufige Verlangsamung:
- #define SIM_SLOW 1
-
- #if (SIM_SLOW)
- # define SUPPRESS_SLOWSTEP -1.0
- #endif
-
-
- // ===========================================================================
- // 'Wissenswertes' aus verschiedenen Bereichen (reduziert AbhΣngigkeiten)
- // ===========================================================================
-
- extern double w2n; // Fensterskalierung (graph.C)
-
- typedef long ColorId;
-
-
- #define SOUND_SUBSYSTEM 1
- #if (SOUND_SUBSYSTEM)
- extern int sound_request; // sound einschalten (main.C)
- #endif
- extern int size; // gewⁿnschte (aktuelle) Fenstergr÷▀e (main.C)
- extern int deluxe; // Luxus-Flag (main.C)
- extern int light_flag; // Light-Sources (main.C)
- extern int color_flag; // table color (main.C)
- extern int nohint_flag; // aiming hint (main.C)
- #define ON_ROOT -1
-
-
- void show_defaults();
- void load_konfi();
-
- #endif
- E 1
-